#ifndef FILEUTILS_H
#define FILEUTILS_H

#include "JWTS_global.h"
#include <QDir>

class QFile;
class QString;

int JWTS_EXPORT CloseHandle(QFile &hFile);

FILE JWTS_EXPORT *fopenu(const char *filename, const char *mode);
FILE JWTS_EXPORT *fopenu(const wchar_t *filename, const wchar_t *mode);

long long JWTS_EXPORT GetFileSize(const QFile &file,void*);

QString JWTS_EXPORT pathLevelUpToExe(const int n_levels);

QString JWTS_EXPORT diskRoot();

QString JWTS_EXPORT fullNameExistingCase(const QString &dir_path, const QString &file_name,
                                         const QDir::Filters filters = QDir::Files);

class JWTS_EXPORT AutoFile
{
public:
    AutoFile(FILE &file);
    ~AutoFile();
private:
    FILE &file;
};

#endif // FILEUTILS_H
